<template>
  <div class="box">
    <h3>父组件</h3>
    <h4>子给我的玩具：{{wanju}}</h4>
    <Child @send-toy="wanju = $event"/>
  </div>
</template>

<script>
  import Child from './Child.vue'

  export default {
    name: 'Index',
    components:{Child},
    data() {
      return {
        wanju:''
      }
    },
  }
</script>

<style lang="less" scoped>
	.box{
		background-color:rgb(178, 178, 178);
		padding: 20px;
    border-radius: 10px;
		button{
			margin-right: 5px;
		}
	}
</style>